package com.dm.biz.base.service.impl;

import com.dm.biz.base.dao.DmImageDao;
import com.dm.biz.base.pojo.DmImage;
import com.dm.biz.base.service.DmImageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("dmImageService")
public class DmImageServiceImpl implements DmImageService {

    @Resource
    private DmImageDao dmImageDao;

    @Override
    public List<DmImage> search(Long targetId, Long category, Long type) {
        List<DmImage> list= dmImageDao.findByTargetIdAndCategoryAndType(targetId, category, type);
        if(list.size()==0){
            DmImage dmImage=new DmImage();
            dmImage.setImgUrl("default.png");
            list.add(dmImage);
        }
        return list;
    }
}
